﻿// StdTestDlg.cpp: 实现文件
//

#include "pch.h"
#include "ProjectAA.h"
#include "StdTestDlg.h"
#include "afxdialogex.h"


// CStdTestDlg 对话框

IMPLEMENT_DYNAMIC(CStdTestDlg, CDialogEx)

CStdTestDlg::CStdTestDlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_STD, pParent)
	, OpenColor(FALSE)
	, ColorX0(0)
	, ColorX1(0)
	, ColorX2(0)
	, ColorX3(0)
	, ColorX4(0)
	, ColorX5(0)
	, ColorY0(0)
	, ColorY1(0)
	, ColorY2(0)
	, ColorY3(0)
	, ColorY4(0)
	, ColorY5(0)
	, ColorR0(0)
	, ColorR1(0)
	, ColorR2(0)
	, ColorR3(0)
	, ColorR4(0)
	, ColorR5(0)
	, ColorG0(0)
	, ColorG1(0)
	, ColorG2(0)
	, ColorG3(0)
	, ColorG4(0)
	, ColorG5(0)
	, ColorB0(0)
	, ColorB1(0)
	, ColorB2(0)
	, ColorB3(0)
	, ColorB4(0)
	, ColorB5(0)
	, ColorSpec0(0)
	, ColorSpec1(0)
	, ColorSpec2(0)
	, ColorSpec3(0)
	, ColorSpec4(0)
	, ColorSpec5(0)
	, ColorW(0)
	, ColorH(0)
	, OpenGray(FALSE)
	, GrayX0(0)
	, GrayX1(0)
	, GrayX2(0)
	, GrayX3(0)
	, GrayX4(0)
	, GrayX5(0)
	, GrayY0(0)
	, GrayY1(0)
	, GrayY2(0)
	, GrayY3(0)
	, GrayY4(0)
	, GrayY5(0)
	, GraySpec0(0)
	, GraySpec1(0)
	, GraySpec2(0)
	, GraySpec3(0)
	, GraySpec4(0)
	, GrayW(0)
	, GrayH(0)
{

}

CStdTestDlg::~CStdTestDlg()
{
}

void CStdTestDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Check(pDX, IDC_CHECK1, OpenColor);
	DDX_Text(pDX, IDC_EDIT1, ColorX0);
	DDX_Text(pDX, IDC_EDIT2, ColorX1);
	DDX_Text(pDX, IDC_EDIT4, ColorX2);
	DDX_Text(pDX, IDC_EDIT6, ColorX3);
	DDX_Text(pDX, IDC_EDIT7, ColorX4);
	DDX_Text(pDX, IDC_EDIT8, ColorX5);
	DDX_Text(pDX, IDC_EDIT9, ColorY0);
	DDX_Text(pDX, IDC_EDIT10, ColorY1);
	DDX_Text(pDX, IDC_EDIT11, ColorY2);
	DDX_Text(pDX, IDC_EDIT12, ColorY3);
	DDX_Text(pDX, IDC_EDIT13, ColorY4);
	DDX_Text(pDX, IDC_EDIT14, ColorY5);
	DDX_Text(pDX, IDC_EDIT15, ColorR0);
	DDX_Text(pDX, IDC_EDIT16, ColorR1);
	DDX_Text(pDX, IDC_EDIT17, ColorR2);
	DDX_Text(pDX, IDC_EDIT18, ColorR3);
	DDX_Text(pDX, IDC_EDIT19, ColorR4);
	DDX_Text(pDX, IDC_EDIT20, ColorR5);
	DDX_Text(pDX, IDC_EDIT21, ColorG0);
	DDX_Text(pDX, IDC_EDIT22, ColorG1);
	DDX_Text(pDX, IDC_EDIT23, ColorG2);
	DDX_Text(pDX, IDC_EDIT24, ColorG3);
	DDX_Text(pDX, IDC_EDIT25, ColorG4);
	DDX_Text(pDX, IDC_EDIT26, ColorG5);
	DDX_Text(pDX, IDC_EDIT27, ColorB0);
	DDX_Text(pDX, IDC_EDIT28, ColorB1);
	DDX_Text(pDX, IDC_EDIT29, ColorB2);
	DDX_Text(pDX, IDC_EDIT30, ColorB3);
	DDX_Text(pDX, IDC_EDIT31, ColorB4);
	DDX_Text(pDX, IDC_EDIT32, ColorB5);
	DDX_Text(pDX, IDC_EDIT33, ColorSpec0);
	DDX_Text(pDX, IDC_EDIT34, ColorSpec1);
	DDX_Text(pDX, IDC_EDIT35, ColorSpec2);
	DDX_Text(pDX, IDC_EDIT36, ColorSpec3);
	DDX_Text(pDX, IDC_EDIT37, ColorSpec4);
	DDX_Text(pDX, IDC_EDIT38, ColorSpec5);
	DDX_Text(pDX, IDC_EDIT39, ColorW);
	DDX_Text(pDX, IDC_EDIT40, ColorH);
	DDX_Check(pDX, IDC_CHECK5, OpenGray);
	DDX_Text(pDX, IDC_EDIT41, GrayX0);
	DDX_Text(pDX, IDC_EDIT42, GrayX1);
	DDX_Text(pDX, IDC_EDIT43, GrayX2);
	DDX_Text(pDX, IDC_EDIT44, GrayX3);
	DDX_Text(pDX, IDC_EDIT45, GrayX4);
	DDX_Text(pDX, IDC_EDIT46, GrayX5);
	DDX_Text(pDX, IDC_EDIT47, GrayY0);
	DDX_Text(pDX, IDC_EDIT48, GrayY1);
	DDX_Text(pDX, IDC_EDIT49, GrayY2);
	DDX_Text(pDX, IDC_EDIT50, GrayY3);
	DDX_Text(pDX, IDC_EDIT51, GrayY4);
	DDX_Text(pDX, IDC_EDIT52, GrayY5);
	DDX_Text(pDX, IDC_EDIT53, GraySpec0);
	DDX_Text(pDX, IDC_EDIT54, GraySpec1);
	DDX_Text(pDX, IDC_EDIT55, GraySpec2);
	DDX_Text(pDX, IDC_EDIT56, GraySpec3);
	DDX_Text(pDX, IDC_EDIT57, GraySpec4);
	DDX_Text(pDX, IDC_EDIT58, GrayW);
	DDX_Text(pDX, IDC_EDIT59, GrayH);
}


BEGIN_MESSAGE_MAP(CStdTestDlg, CDialogEx)
	ON_BN_CLICKED(IDC_BUTTON_SAVE, &CStdTestDlg::OnBnClickedButtonSave)
	ON_EN_CHANGE(IDC_EDIT1, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT2, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT4, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT6, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT7, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT8, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT9, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT10, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT11, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT12, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT13, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT14, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT41, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT42, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT43, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT44, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT45, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT46, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT47, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT48, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT49, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT50, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT51, &CStdTestDlg::OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT52, &CStdTestDlg::OnEnChangeEdit1)
END_MESSAGE_MAP()


// CStdTestDlg 消息处理程序


BOOL CStdTestDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	ReadConfigIni();

	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}


void CStdTestDlg::OnCancel()
{
	m_nInitFlag = 0;

	CDialogEx::OnCancel();
}

void CStdTestDlg::ReadConfigIni()
{
	OpenColor = gSystemMgr.m_nColorTestFlag;
	ColorX0 = gSystemMgr.m_nColorRoiX[0];
	ColorX1 = gSystemMgr.m_nColorRoiX[1];
	ColorX2 = gSystemMgr.m_nColorRoiX[2];
	ColorX3 = gSystemMgr.m_nColorRoiX[3];
	ColorX4 = gSystemMgr.m_nColorRoiX[4];
	ColorX5 = gSystemMgr.m_nColorRoiX[5];
	ColorY0 = gSystemMgr.m_nColorRoiY[0];
	ColorY1 = gSystemMgr.m_nColorRoiY[1];
	ColorY2 = gSystemMgr.m_nColorRoiY[2];
	ColorY3 = gSystemMgr.m_nColorRoiY[3];
	ColorY4 = gSystemMgr.m_nColorRoiY[4];
	ColorY5 = gSystemMgr.m_nColorRoiY[5];
	ColorR0 = gSystemMgr.m_nColorRefR[0];
	ColorR1 = gSystemMgr.m_nColorRefR[1];
	ColorR2 = gSystemMgr.m_nColorRefR[2];
	ColorR3 = gSystemMgr.m_nColorRefR[3];
	ColorR4 = gSystemMgr.m_nColorRefR[4];
	ColorR5 = gSystemMgr.m_nColorRefR[5];
	ColorG0 = gSystemMgr.m_nColorRefG[0];
	ColorG1 = gSystemMgr.m_nColorRefG[1];
	ColorG2 = gSystemMgr.m_nColorRefG[2];
	ColorG3 = gSystemMgr.m_nColorRefG[3];
	ColorG4 = gSystemMgr.m_nColorRefG[4];
	ColorG5 = gSystemMgr.m_nColorRefG[5];
	ColorB0 = gSystemMgr.m_nColorRefB[0];
	ColorB1 = gSystemMgr.m_nColorRefB[1];
	ColorB2 = gSystemMgr.m_nColorRefB[2];
	ColorB3 = gSystemMgr.m_nColorRefB[3];
	ColorB4 = gSystemMgr.m_nColorRefB[4];
	ColorB5 = gSystemMgr.m_nColorRefB[5];
	ColorSpec0 = gSystemMgr.m_nColorSpec[0];
	ColorSpec1 = gSystemMgr.m_nColorSpec[1];
	ColorSpec2 = gSystemMgr.m_nColorSpec[2];
	ColorSpec3 = gSystemMgr.m_nColorSpec[3];
	ColorSpec4 = gSystemMgr.m_nColorSpec[4];
	ColorSpec5 = gSystemMgr.m_nColorSpec[5];
	ColorW = gSystemMgr.m_nColorRoiW;
	ColorH = gSystemMgr.m_nColorRoiH;
	OpenGray = gSystemMgr.m_nGrayTestFlag;
	GrayX0 = gSystemMgr.m_nGrayRoiX[0];
	GrayX1 = gSystemMgr.m_nGrayRoiX[1];
	GrayX2 = gSystemMgr.m_nGrayRoiX[2];
	GrayX3 = gSystemMgr.m_nGrayRoiX[3];
	GrayX4 = gSystemMgr.m_nGrayRoiX[4];
	GrayX5 = gSystemMgr.m_nGrayRoiX[5];
	GrayY0 = gSystemMgr.m_nGrayRoiY[0];
	GrayY1 = gSystemMgr.m_nGrayRoiY[1];
	GrayY2 = gSystemMgr.m_nGrayRoiY[2];
	GrayY3 = gSystemMgr.m_nGrayRoiY[3];
	GrayY4 = gSystemMgr.m_nGrayRoiY[4];
	GrayY5 = gSystemMgr.m_nGrayRoiY[5];
	GraySpec0 = gSystemMgr.m_nGraySpec[0];
	GraySpec1 = gSystemMgr.m_nGraySpec[1];
	GraySpec2 = gSystemMgr.m_nGraySpec[2];
	GraySpec3 = gSystemMgr.m_nGraySpec[3];
	GraySpec4 = gSystemMgr.m_nGraySpec[4];
	GrayW = gSystemMgr.m_nGrayRoiW;
	GrayH = gSystemMgr.m_nGrayRoiH;

	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN3))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN4))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN5))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN6))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN7))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN8))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN9))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN10))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN11))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN12))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN13))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN14))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN15))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN16))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN17))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN18))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN19))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN20))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN21))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN22))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN23))->SetRange(0, 5000);
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN24))->SetRange(0, 5000);
	m_nInitFlag = 1;
	UpdateData(FALSE);
}

void CStdTestDlg::SaveValueToConfig()
{
	UpdateData(TRUE);

	gSystemMgr.m_nColorTestFlag = OpenColor;
	gSystemMgr.m_nColorRoiX[0] = ColorX0;
	gSystemMgr.m_nColorRoiX[1] = ColorX1;
	gSystemMgr.m_nColorRoiX[2] = ColorX2;
	gSystemMgr.m_nColorRoiX[3] = ColorX3;
	gSystemMgr.m_nColorRoiX[4] = ColorX4;
	gSystemMgr.m_nColorRoiX[5] = ColorX5;
	gSystemMgr.m_nColorRoiY[0] = ColorY0;
	gSystemMgr.m_nColorRoiY[1] = ColorY1;
	gSystemMgr.m_nColorRoiY[2] = ColorY2;
	gSystemMgr.m_nColorRoiY[3] = ColorY3;
	gSystemMgr.m_nColorRoiY[4] = ColorY4;
	gSystemMgr.m_nColorRoiY[5] = ColorY5;
	gSystemMgr.m_nColorRefR[0] = ColorR0;
	gSystemMgr.m_nColorRefR[1] = ColorR1;
	gSystemMgr.m_nColorRefR[2] = ColorR2;
	gSystemMgr.m_nColorRefR[3] = ColorR3;
	gSystemMgr.m_nColorRefR[4] = ColorR4;
	gSystemMgr.m_nColorRefR[5] = ColorR5;
	gSystemMgr.m_nColorRefG[0] = ColorG0;
	gSystemMgr.m_nColorRefG[1] = ColorG1;
	gSystemMgr.m_nColorRefG[2] = ColorG2;
	gSystemMgr.m_nColorRefG[3] = ColorG3;
	gSystemMgr.m_nColorRefG[4] = ColorG4;
	gSystemMgr.m_nColorRefG[5] = ColorG5;
	gSystemMgr.m_nColorRefB[0] = ColorB0;
	gSystemMgr.m_nColorRefB[1] = ColorB1;
	gSystemMgr.m_nColorRefB[2] = ColorB2;
	gSystemMgr.m_nColorRefB[3] = ColorB3;
	gSystemMgr.m_nColorRefB[4] = ColorB4;
	gSystemMgr.m_nColorRefB[5] = ColorB5;
	gSystemMgr.m_nColorSpec[0] = ColorSpec0;
	gSystemMgr.m_nColorSpec[1] = ColorSpec1;
	gSystemMgr.m_nColorSpec[2] = ColorSpec2;
	gSystemMgr.m_nColorSpec[3] = ColorSpec3;
	gSystemMgr.m_nColorSpec[4] = ColorSpec4;
	gSystemMgr.m_nColorSpec[5] = ColorSpec5;
	gSystemMgr.m_nColorRoiW = ColorW;
	gSystemMgr.m_nColorRoiH = ColorH;
	gSystemMgr.m_nGrayTestFlag = OpenGray;
	gSystemMgr.m_nGrayRoiX[0] = GrayX0;
	gSystemMgr.m_nGrayRoiX[1] = GrayX1;
	gSystemMgr.m_nGrayRoiX[2] = GrayX2;
	gSystemMgr.m_nGrayRoiX[3] = GrayX3;
	gSystemMgr.m_nGrayRoiX[4] = GrayX4;
	gSystemMgr.m_nGrayRoiX[5] = GrayX5;
	gSystemMgr.m_nGrayRoiY[0] = GrayY0;
	gSystemMgr.m_nGrayRoiY[1] = GrayY1;
	gSystemMgr.m_nGrayRoiY[2] = GrayY2;
	gSystemMgr.m_nGrayRoiY[3] = GrayY3;
	gSystemMgr.m_nGrayRoiY[4] = GrayY4;
	gSystemMgr.m_nGrayRoiY[5] = GrayY5;
	gSystemMgr.m_nGraySpec[0] = GraySpec0;
	gSystemMgr.m_nGraySpec[1] = GraySpec1;
	gSystemMgr.m_nGraySpec[2] = GraySpec2;
	gSystemMgr.m_nGraySpec[3] = GraySpec3;
	gSystemMgr.m_nGraySpec[4] = GraySpec4;
	gSystemMgr.m_nGrayRoiW = GrayW;
	gSystemMgr.m_nGrayRoiH = GrayH;

	CString cstr;
	cstr.Format(L"%d", gSystemMgr.m_nColorTestFlag); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorTestFlag", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorRoiX[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiX[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiX[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiX[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiX[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiX[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiX[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiX[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiX[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiX[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiX[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiX[5]", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorRoiY[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiY[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiY[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiY[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiY[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiY[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiY[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiY[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiY[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiY[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiY[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiY[5]", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorRoiW); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiW", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRoiH); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRoiH", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorRefR[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefR[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefR[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefR[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefR[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefR[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefR[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefR[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefR[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefR[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefR[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefR[5]", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorRefG[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefG[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefG[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefG[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefG[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefG[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefG[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefG[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefG[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefG[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefG[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefG[5]", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorRefB[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefB[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefB[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefB[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefB[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefB[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefB[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefB[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefB[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefB[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorRefB[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorRefB[5]", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nColorSpec[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorSpec[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorSpec[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorSpec[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorSpec[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorSpec[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorSpec[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorSpec[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorSpec[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorSpec[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nColorSpec[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nColorSpec[5]", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nGrayTestFlag); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayTestFlag", cstr);

	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiX[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiX[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiX[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiX[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiX[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiX[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiX[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiX[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiX[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiX[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiX[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiX[5]", cstr);
																																	  
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiY[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiY[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiY[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiY[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiY[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiY[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiY[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiY[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiY[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiY[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiY[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiY[5]", cstr);
																																	  
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiW); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiW", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGrayRoiH);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGrayRoiH", cstr);
																																	  
	cstr.Format(L"%d", gSystemMgr.m_nGraySpec[0]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGraySpec[0]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGraySpec[1]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGraySpec[1]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGraySpec[2]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGraySpec[2]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGraySpec[3]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGraySpec[3]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGraySpec[4]); gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGraySpec[4]", cstr);
	cstr.Format(L"%d", gSystemMgr.m_nGraySpec[5]);gSystemMgr.m_cCaptureConfigIni.SaveConfigIni(L"STDSetting", L"m_nGraySpec[5]", cstr);

	gSystemLog.DisplayLogAndSave(L"STD保存数据完成", LV_EVENT);
}


void CStdTestDlg::OnBnClickedButtonSave()
{
	SaveValueToConfig();
}


void CStdTestDlg::OnEnChangeEdit1()
{
	if (!m_nInitFlag)return;
	UpdateData(TRUE);

	this->SaveValueToConfig();
}
